<template>
  <BasicDrawer v-bind="$attrs" @register="registerDrawer" title="接口详情" width="600px">
    <Description :column="1" :data="detailData" @register="registerDescription" />
  </BasicDrawer>
</template>
<script lang="ts" setup>
  import { ref, useAttrs } from 'vue';
  import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
  import { formDetailSchema } from './payIfDefine.data';
  import { Description, useDescription } from '/@/components/Description/index';
  import {getByIfCode} from './payIfDefine.api';
  const emit = defineEmits(['register']);
  const attrs = useAttrs();

  const [registerDescription] = useDescription({
    // data: mockData,
    schema: formDetailSchema,
    labelStyle: {
      marginLeft: '10px',
      width: '180px'
    }
  });

  const detailData = ref({});
  const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
    setDrawerProps({ confirmLoading: false });
    const detail = await getByIfCode({ifCode: data.record.ifCode})
    detailData.value = detail;
  });
</script>


<style scoped>

</style>